package com.cmit.upay.monitor;

import com.cmit.upay.monitor.properties.ActiveMQProperties;
import com.cmit.upay.monitor.service.MonitorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * 调用关系：MonitorService#doService -> ActiveMQMonitor#monitorUserXXX
 */
@SpringBootApplication
@EnableAsync
@EnableScheduling
public class ActivemqMonitorApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(ActivemqMonitorApplication.class);
        springApplication.setWebEnvironment(false);
        springApplication.run(args);
//        SpringApplication.run(ActivemqMonitorApplication.class, args);
    }

    @Autowired
    private ActiveMQProperties activeMQProperties;
    @Autowired
    private MonitorService monitorService;

    @Override
    public void run(String... strings) throws Exception {
        System.out.println(activeMQProperties);
//        monitorService.doService();
    }
}
